﻿<phone:PhoneApplicationPage 
    x:Class="OnlineVideos.Favorites"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:my="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI"  
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:LART="clr-namespace:OnlineVideos"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
       xmlns:inputtoolkit="clr-namespace:MarkHeath.StarRating;assembly=MarkHeath.StarRating"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False"
    Loaded="PhoneApplicationPage_Loaded">
   
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--Pivot Control-->
      <phone:Pivot x:Name="pvtMainFavorites">
        <phone:Pivot.Title>
                <StackPanel Orientation="Horizontal" Margin="-20,0,0,0">
                    <Image Style="{StaticResource DetailPagePivotTitleImage}" x:Name="imgTitle" MouseEnter="imgTitle_MouseEnter"/>
                    <TextBlock  x:Name="tblkVideosTitle" Text="FAVORITES" Style="{StaticResource DetailPagePivotTitle}"/>
                </StackPanel>
            </phone:Pivot.Title>
        <phone:Pivot.Foreground>
                white
            </phone:Pivot.Foreground>

            <!--Pivot item one-->
        <phone:PivotItem x:Name="pvtitmVideos">
                <Grid x:Name="VideoGrid">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="80"/>
                    </Grid.RowDefinitions>
                    <ListBox x:Name="lbxVidoes" Width="470" SelectionChanged="lbxMovies_SelectionChanged" Foreground="White" Grid.Row="0">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid Height="200">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="115"/>
                                        <ColumnDefinition Width="350"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Image Grid.Column="0" Grid.Row="0"  Source="{Binding ImgSource}" VerticalAlignment="Top" Width="100" Height="170"  />
                                    <StackPanel Grid.Column="1" Grid.Row="0" Margin="15,0,0,0" Height="210">
                                        <TextBlock Text="{Binding Title}" FontSize="24" FontWeight="Bold" TextWrapping="Wrap" Margin="10,0,0,0" Foreground="White"></TextBlock>
                                        <StackPanel Margin="10,10,0,0" Orientation="Horizontal">
                                            <inputtoolkit:StarRatingControl Name="rate" Rating="{Binding Rating}" Tag="{Binding MovieId}"  NumberOfStars="5" Height="25" Width="139"  ></inputtoolkit:StarRatingControl>
                                            <TextBlock Text="{Binding Release}" FontSize="22" Margin="70,0,0,0"  Foreground="White"></TextBlock>
                                        </StackPanel>
                                        <TextBlock Text="{Binding Genre}" FontSize="22" Margin="10,10,0,0" Foreground="White"></TextBlock>
                                        <StackPanel Orientation="Horizontal"  Margin="10,10,0,0">
                                            <TextBlock Text="Language: " FontSize="22" Foreground="White"></TextBlock>
                                            <TextBlock Text="{Binding SubTitle}" FontSize="22" TextWrapping="Wrap" Foreground="White"></TextBlock>
                                        </StackPanel>
                                    </StackPanel>
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <StackPanel Name="adstackplFavoriteVideos" Grid.Row="1" Orientation="Vertical"  Margin="-4,3,0,0">
                    </StackPanel>
                    <Canvas>
                        <TextBlock Margin="100,200,0,0" FontSize="28" x:Name="tblk" Visibility="Collapsed"/>
                    </Canvas>
                </Grid>
            </phone:PivotItem>

        <phone:PivotItem x:Name="pvtitemSongs">

                <Grid x:Name="songGrid">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="80"/>
                    </Grid.RowDefinitions>
                    <ListBox x:Name="lbxFavoritesongs" Margin="0,-30,0,10" Grid.Row="0" SelectionChanged="lbxFavoritesongs_SelectionChanged" Foreground="White">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Height="100" VerticalAlignment="Top" >
                                    <toolkit:ContextMenuService.ContextMenu>
                                        <toolkit:ContextMenu>
                                            <toolkit:MenuItem Header="remove from favorites" Click="btnFavSong_Click"/>
                                        </toolkit:ContextMenu>
                                    </toolkit:ContextMenuService.ContextMenu>
                                    <Image Source="/Images/ArrowImg.png" Height="43" Width="43" VerticalAlignment="Center" Margin="10,10,20,0"/>
                                    <TextBlock Width="400" Text="{Binding Title}" Margin="-2,4,0,0" FontSize="26" VerticalAlignment="Center" TextWrapping="Wrap"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <StackPanel Name="adstackpl" Grid.Row="1" Orientation="Vertical"  Margin="-4,3,0,0">
                    </StackPanel>
                    <Canvas>
                        <TextBlock Canvas.Top="200" Canvas.Left="80" FontSize="28" x:Name="tblkFavNoSongs" Visibility="Collapsed"/>
                    </Canvas>
                </Grid>

            </phone:PivotItem>
        <phone:PivotItem x:Name="pvtitemAudio">

                <Grid x:Name="AudioGrid">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="80"/>
                    </Grid.RowDefinitions>
                    <ListBox x:Name="lbxFavoriteaudio" Margin="0,-30,0,10" Grid.Row="0" SelectionChanged="lbxFavoriteaudio_SelectionChanged" Foreground="White">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Height="100" VerticalAlignment="Top" >
                                    <toolkit:ContextMenuService.ContextMenu>
                                        <toolkit:ContextMenu>
                                            <toolkit:MenuItem Header="remove from favorites" Click="btnAudioFavSong_Click"/>
                                        </toolkit:ContextMenu>
                                    </toolkit:ContextMenuService.ContextMenu>
                                    <Image Source="{Binding Songplay}" Height="43" Width="43" VerticalAlignment="Center" Margin="10,33,20,0"  Tag="{Binding Songplay}" x:Name="audioimg"/>
                                    <TextBlock Text="{Binding Title}" Name="tblkchno" Margin="-2,30,0,0" Width="400" FontSize="28" VerticalAlignment="Center" TextWrapping="Wrap" Tag="{Binding Link}"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <StackPanel Name="adstackplaudio" Grid.Row="1" Orientation="Vertical"  Margin="-4,3,0,0">
                    </StackPanel>
                    <Canvas>
                        <TextBlock Canvas.Top="200" Canvas.Left="80" FontSize="28" x:Name="tblkFavNoAudio" Visibility="Collapsed"/>
                    </Canvas>
                </Grid>

            </phone:PivotItem>
        </phone:Pivot>

    </Grid>
</phone:PhoneApplicationPage>